package com.sz.biz.logistics.ord.enums;

import com.sz.common.base.dao.ext.IEnum;

/**
 * Package: com.sz.biz.logistics.ord.enums<br>
 * Function: 货物类型
 * Author: chenzhaohui.<br>
 * Date: 2017-11-27 14:26:00.
 */
public enum CargoTypeEnum implements IEnum {
    FILE("GT001", "文件"),//文件
    SMALL_BAG("GT002","普通小包"),//普通小包
    BIG_BAG("GT003","普通大包"),//普通大包
    ELECTRONIC("GT005", "电子"),//电子
    BATTERY("GT006","电池"),//电池
    FRESH("GT004","生鲜");//生鲜
    private String code;
    private String name;

    CargoTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static CargoTypeEnum valueOfEnum(String code) {
        CargoTypeEnum[] iss = values();
        for (CargoTypeEnum cs : iss) {
            if (cs.getCode().equals(code)) {
                return cs;
            }
        }
        return null;
    }
}
